using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TablePriceTax
	{
		public const string Table = "PriceTax";
		public const string PriceTaxID = "PriceTaxID";
		public const string CityID = "CityID";
		public const string MinPrice = "MinPrice";
		public const string MaxPrice = "MaxPrice";
		public const string Tax = "Tax";
	}
	
	[Serializable]
	public class BasePriceTax
		: IDbSessionEntity, IJsonClass
	{
		int m_PriceTaxID;
		/// <summary>
        /// 价格调节锐表ID
        /// </summary>
        public int PriceTaxID
        {
            get { return m_PriceTaxID; }
            set { m_PriceTaxID = value; }
        }
		
		int? m_CityID;
		/// <summary>
        /// 城市表ID
        /// </summary>
        public int? CityID
        {
            get { return m_CityID; }
            set { m_CityID = value; }
        }
		
		double m_MinPrice;
		/// <summary>
        /// 起始价格段
        /// </summary>
        public double MinPrice
        {
            get { return m_MinPrice; }
            set { m_MinPrice = value; }
        }
		
		double m_MaxPrice;
		/// <summary>
        /// 结束价格
        /// </summary>
        public double MaxPrice
        {
            get { return m_MaxPrice; }
            set { m_MaxPrice = value; }
        }
		
		double m_Tax;
		/// <summary>
        /// 
        /// </summary>
        public double Tax
        {
            get { return m_Tax; }
            set { m_Tax = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_PriceTaxID = reader[TablePriceTax.PriceTaxID];
            m_CityID = reader[TablePriceTax.CityID];
            m_MinPrice = reader[TablePriceTax.MinPrice];
            m_MaxPrice = reader[TablePriceTax.MaxPrice];
            m_Tax = reader[TablePriceTax.Tax];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TablePriceTax.PriceTaxID, PrimaryKeyType.Identity, PriceTaxID);
			writer[TablePriceTax.CityID] = CityID;
			writer[TablePriceTax.MinPrice] = MinPrice;
			writer[TablePriceTax.MaxPrice] = MaxPrice;
			writer[TablePriceTax.Tax] = Tax;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_PriceTaxID = idd;
        }
		
		public string TableName
        {
            get { return TablePriceTax.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_PriceTaxID = hashToRead["PriceTaxID"];
			 
             m_CityID = hashToRead["CityID"];
			 
             m_MinPrice = hashToRead["MinPrice"];
			 
             m_MaxPrice = hashToRead["MaxPrice"];
			 
             m_Tax = hashToRead["Tax"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["PriceTaxID"] = PriceTaxID;
			 
            hashToFill["CityID"] = CityID;
			 
            hashToFill["MinPrice"] = MinPrice;
			 
            hashToFill["MaxPrice"] = MaxPrice;
			 
            hashToFill["Tax"] = Tax;
			 
        }

        #endregion
		
	}
}
